In the “Appl.” field you enter the name of the AppleScript applet containing the subroutine you want to call from the AppleScript event. Be sure that this applet is running before you attempt to call it from DynRisk.

In the “Subr.” field you enter the name of the subroutine you want to call.

Note that to be able to call a subroutine, its name cannot contain any capital letters!

Thus, you cannot call a subroutine whose called “MyFamousRoutine”. The reason for this strange limitation is probably only known by Apple Computers.

As a very simple example, consider the following AppleScript subroutine:

on mysub(x)

return 2 * x + 7
end mysub

To access this from an AppleScript event, you enter the name of the subroutine, i.e., “mysub” into the “Subr.” field.

If during a simulation, the event gets an input value of e.g., 4, this value is passed as an argument to the mysub subroutine, which returns 2*4 + 7 =15. Assuming that the “Expect script reply” option was checked, the value 15 will eventually be passed on to the successors of the event.